package com.test.consumer;

import java.io.IOException;

import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.test.api.Hello;

public class Comsumer {

	public static void main(String[] args) {
		ClassPathXmlApplicationContext app = new ClassPathXmlApplicationContext("classpath:dubbo*.xml");
		
		app.start();
		
		Hello hello = app.getBean(Hello.class);
		
		for (int i = 0; i < 10; i++) {
			try {
				Thread.sleep(1000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			String str = hello.sayHello("i = " + i);
			System.out.println(str);
		}
		
		try {
			System.in.read();
		} catch (IOException e) {
			e.printStackTrace();
		}
		
	}
}
